[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)
authorZhang Yu <zhangyub@uniontech.com>
Mon, 22 Feb 2021 01:25:01 +0000 (09:25 +0800)
committerThorsten Alteholz <debian@alteholz.de>
Sun, 28 Apr 2024 20:48:02 +0000 (22:48 +0200)
commit3da0c190a386cca03497506b837c7f91ffad6f83
tree3ee2bee1f42645b5e41d74d3c5b604e77de94f0a
parent1cc376ff0a71fb30a19642ab5df1b7e89413ccdc
[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)

QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Gbp-Pq: Name fix-invalid-pointer-return-with-QGridLayout.diff
src/widgets/kernel/qgridlayout.cpp
tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp